package com.foreveross.fetl.core.domain.freight;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.dayatang.domain.InstanceFactory;
import com.foreveross.fetl.common.domain.BaseEntity;
import com.foreveross.fetl.core.domain.freight.repository.IOfficialPlusDayRepository;

@Entity
@Table(name="official_plus_day")
public class OfficialPlusDayEntity extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = -372715412997686728L;
		
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	
	//统计日期
	@Column(name="REPORT_DATE")
	private Date reportDate;
		
	//官网rowkey
	@Column(name="HBASE_KEY")
	private String hbaseKey;
		
	//渠道rowkey
	@Column(name="CHANNEL")
	private String channel;
		
	//出发城市三字码
	@Column(name="FROM_CITY")
	private String fromCity;
		
	//出发城市名称
	@Column(name="FROM_CITY_NAME")
	private String fromCityName;
		
	//到达城市三字码
	@Column(name="TO_CITY")
	private String toCity;
		
	 //到达城市名称
	@Column(name="TO_CITY_NAME")
	private String toCityName;
		
		
	//超官网 3%
	@Column(name="THRESHOLD_03")
	private Integer threshold03;
		
	//超官网6%
	@Column(name="THRESHOLD_06")
	private Integer threshold06;
	
	//生成时间
	@Column(name="CREATE_TIME")
	private Date createTime;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Date getReportDate() {
		return reportDate;
	}

	public void setReportDate(Date reportDate) {
		this.reportDate = reportDate;
	}

	public String getHbaseKey() {
		return hbaseKey;
	}

	public void setHbaseKey(String hbaseKey) {
		this.hbaseKey = hbaseKey;
	}

	public String getChannel() {
		return channel;
	}

	public void setChannel(String channel) {
		this.channel = channel;
	}

	public String getFromCity() {
		return fromCity;
	}

	public void setFromCity(String fromCity) {
		this.fromCity = fromCity;
	}

	public String getFromCityName() {
		return fromCityName;
	}

	public void setFromCityName(String fromCityName) {
		this.fromCityName = fromCityName;
	}

	public String getToCity() {
		return toCity;
	}

	public void setToCity(String toCity) {
		this.toCity = toCity;
	}

	public String getToCityName() {
		return toCityName;
	}

	public void setToCityName(String toCityName) {
		this.toCityName = toCityName;
	}


	public Integer getThreshold03() {
		return threshold03;
	}

	public void setThreshold03(Integer threshold03) {
		this.threshold03 = threshold03;
	}

	public Integer getThreshold06() {
		return threshold06;
	}

	public void setThreshold06(Integer threshold06) {
		this.threshold06 = threshold06;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	public IOfficialPlusDayRepository getIOfficialPlusDayRepository(){
		return InstanceFactory.getInstance(IOfficialPlusDayRepository.class);
	}
	public List<OfficialPlusDayEntity> findByCondition(Date reportDate,
			  String fromCity, String toCity,String channel,String hbaseKey){
		return getIOfficialPlusDayRepository().findByCondition(reportDate, fromCity, toCity, channel, hbaseKey);
	}
	
	public void save(OfficialPlusDayEntity entity){
		getIOfficialPlusDayRepository().save(entity);
	}
	
}
